//
//  ViewController.m
//  4-19
//
//  Created by mac on 16-4-19.
//  Copyright (c) 2016年 zhd. All rights reserved.
//

#import "ViewController.h"

@interface ViewController (){
    NSArray *data;

}

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    self.view.backgroundColor=[UIColor greenColor];//改背景颜色
    UITableView *tableView=[[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain];//制作表格
     tableView.dataSource = self;
    [self.view addSubview:tableView];
    data=@[@"shabi",
           @"蠢猪",
           @"彭阳是蠢狗"
           
           
    
    
           ];
    
    
}


-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return data.count;

}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    UITableViewCell *cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    cell.textLabel.text=data[indexPath.row];
    return cell;
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
